import Vue from 'vue'
import App from './App.vue'
import Vuex from "vuex";
import store from './store'
import ElementUI from 'element-ui';	// Element 1
import 'element-ui/lib/theme-chalk/index.css'; // Element 2
import VueRouter from 'vue-router' // 路由 1
import router from './router' // 路由 2
import axios from 'axios'
import VueAxios from 'vue-axios'



// 使用插件
Vue.use(ElementUI); // Element 3
Vue.use(VueRouter);
Vue.use(VueAxios,axios);
Vue.use(Vuex);
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
// 添加请求拦截器
// 添加请求拦截器
axios.defaults.baseURL = 'http://127.0.0.1:8888'
axios.interceptors.request.use(config => {
// console.log(config)
  config.headers.Authorization = sessionStorage.getItem('token')
// 在最后必须 return config
  return config
})


